﻿namespace NEvoWeb.Modules.NB_Store
{
    using DotNetNuke.Entities.Portals;
    using Microsoft.VisualBasic;
    using System;

    public abstract class CalcExtraInterface
    {
        private static CalcExtraInterface objProvider = null;

        static CalcExtraInterface()
        {
            CreateProvider();
        }

        protected CalcExtraInterface()
        {
        }

        private static void CreateProvider()
        {
            string storeSetting = SharedFunctions.GetStoreSetting(PortalSettings.Current.PortalId, "calcextra.provider");
            if (storeSetting != "")
            {
                string[] strArray = Strings.Split(storeSetting, ",", -1, CompareMethod.Binary);
                objProvider = (CalcExtraInterface) Activator.CreateInstance(strArray[0], strArray[1]).Unwrap();
            }
        }

        public abstract CartTotals getCartTotals(int PortalID, string CartID, CartTotals objCartTotals);
        public static CalcExtraInterface Instance()
        {
            return objProvider;
        }
    }
}

